<?php

if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Headpair extends CI_Controller {

	public $send_sms = false;

	function __construct() {
		parent::__construct();
		
		$this -> load -> library("login_lib");
		$this -> load -> library("pair_lib");
		$this -> load -> library('pattern_lib');
		$this -> load -> library('show_test');
		$this -> load -> library("send_html");
		$this -> load -> library('show_test');
		$this -> load -> library("mapping");
		$this -> load -> library('pagination');	
		$this -> load -> library('base_data_lib');	
		
		
		$this -> load -> model('object_temporary_model');		
				
		$this -> load -> model('pair_model');			


		$this -> load -> model('windows_model');			
		$this -> load -> model('market_state_model');			


		$this -> load -> model('parking_type_model');
		
				
		$this -> load -> model('pattern_model');		
		$this -> load -> model('parking_type_model');
		$this -> load -> model('object_model');
		$this -> load -> model('demand_model');
		$this -> load -> model('client_model');
		$this -> load -> model("demand_m");
		$this -> load -> model("object_m");
		$this -> load -> model('users_model');
		
		$this -> load -> model('parking_type_model');
		$this -> load -> model('object_state_model');
		$this -> load -> model('market_state_model');
		$this -> load -> model('building_name_model');
		$this -> load -> model('currency_model');
		$this -> load -> model('area_unit_model');
				
							
		
		$this -> load -> model('pair_model');
		$this -> load -> model('market_model');
		$this -> load -> model('client_model');
		$this -> load -> model('users_model');
		$this -> load -> model('object_state_model');
		$this -> load -> model('market_state_model');
		$this -> load -> model('building_name_model');
		$this -> load -> model('building_name_model');
		$this -> load -> model('emphasis_area_model');
		$this -> load -> model('address_city_model');
		$this -> load -> model('address_county_model');
		$this -> load -> model('building_name_model');
		$this -> load -> model('emphasis_area_model');
		$this -> load -> model('address_city_model');
		$this -> load -> model('address_county_model');
	}

	public function demand() {
		
		$html = $this -> init("店頭－需求配物件&市調", "jquery", "table");
		$html["building_name"] = $this -> building_name_model -> get_all_new();		
		$html["emphasis_area"] = $this -> emphasis_area_model -> get_all_new();
		$html["address_city"] 	= $this -> address_city_model -> get_all_new();
		$html["address_county"] 	= $this -> address_county_model -> get_by_id('1');
		$html["users"] 			= $this -> base_data_lib->get_all_users_array();
		$html["object_usages"] 	= $this ->base_data_lib ->get_object_usage_array();
		
		$this -> load -> view('headpair/head_pair_demand',$html);		
	}
	
	public function object() {
		
		$html = $this -> init("店頭－物件配需求", "jquery", "table");

		$html["building_name"] 	= $this -> building_name_model -> get_all_new();		
		$html["emphasis_area"] 	= $this -> emphasis_area_model -> get_all_new();
		$html["address_city"] 	= $this -> address_city_model -> get_all_new();
		$html["address_county"] 	= $this -> address_county_model -> get_by_id('1');
		$html["users"] 			= $this -> base_data_lib->get_all_users_array();
		$html["object_usages"] 	= $this ->base_data_lib ->get_object_usage_array();

		$this -> load -> view('headpair/market_pair',$html);
		
	}
	
	public function market() {
		
		$html = $this -> init("店頭－市調配需求", "jquery", "table");
		$html["building_name"] = $this -> building_name_model -> get_all_new();		
		$html["emphasis_area"] = $this -> emphasis_area_model -> get_all_new();
		$html["address_city"] 	= $this -> address_city_model -> get_all_new();
		$html["address_county"] 	= $this -> address_county_model -> get_by_id('1');
		$html["users"] 			= $this -> base_data_lib->get_all_users_array();
		$html["object_usages"] 	= $this ->base_data_lib ->get_object_usage_array();
		$this -> load -> view('headpair/market_pair',$html);
		
	}

}
